import 'package:flutter/material.dart';

class NoResultWidget extends StatelessWidget {
  final String icon;
  final String desc;
  final double marginTop;
  final double marginBottom;

  NoResultWidget(this.icon, this.desc,{this.marginTop = 150,this.marginBottom = 0});

  @override
  Widget build(BuildContext context) {
    return Container(
        alignment: Alignment.center,
        padding: EdgeInsets.only(top: marginTop,bottom: marginBottom),
        child: Stack(
          children: <Widget>[
            Container(
              child: Column(
//                direction: Axis.vertical,
//                crossAxisAlignment: WrapCrossAlignment.center,
                children: <Widget>[
                  Image.asset(
//                'images/img_no_accident.png',
                    desc == "暂无网络" ? 'images/img_no_network.png': icon,
                    scale: 2.5,
                  ),
                  Padding(
                    padding: EdgeInsets.only(left: 20, right: 20, top: 20),
                    child: Text(
                      desc,
                      style: TextStyle(
                          fontSize: 15, color: Color.fromRGBO(0, 0, 0, 1)),
                    ),
                  ),
                ],
              ),
            )
          ],
        ));
  }
}
